
<div class="col-lg-12">
    <div class="row">
        <h4 class="text-info">Definition</h4>
    </div>
    
    <div class="row m-b-sm">
        <div class="col-lg-3">
            Name:
        </div>

        <div class="col-lg-9">
            <?php echo $category['OrganisationMemberCategory']['name']; ?>
        </div>
    </div>
    
    <div class="row m-b-sm">
        <div class="col-lg-3">
            Slug:
        </div>

        <div class="col-lg-9">
            <?php echo $category['OrganisationMemberCategory']['slug']; ?>
        </div>
    </div>
    
    <div class="row m-b-sm">
        <div class="col-lg-3">
            Description:
        </div>

        <div class="col-lg-9">
            <?php echo $category['OrganisationMemberCategory']['description']; ?>
        </div>
    </div>
    
    <div class="row m-b-sm">
        <div class="col-lg-3">
            ID Prefix:
        </div>

        <div class="col-lg-9">
            <?php echo $category['OrganisationMemberCategory']['id_prefix'] != '' ? $category['OrganisationMemberCategory']['id_prefix'] : "--"; ?>
        </div>
    </div>
    
    <div class="row m-b-sm">
        <div class="col-lg-3">
            ID Suffix:
        </div>

        <div class="col-lg-9">
            <?php echo $category['OrganisationMemberCategory']['id_suffix'] != '' ? $category['OrganisationMemberCategory']['id_suffix'] : "--"; ?>
        </div>
    </div>
    
    <div class="row m-b-sm">
        <div class="col-lg-3">
            ID Next Increment:
        </div>

        <div class="col-lg-9">
            <?php echo $category['OrganisationMemberCategory']['id_next_increment']; ?>
        </div>
    </div>
    
    <div class="row m-b-sm">
        <div class="col-lg-3">
            Default:
        </div>

        <div class="col-lg-9">
            <?php echo $category['OrganisationMemberCategory']['default'] == 1 ? "<b class='text-success'>Yes</b>" : "<b>No</b>"; ?>
        </div>
    </div>
    
    <div class="row m-b-sm">
        <div class="col-lg-3">
            Registration URL:
        </div>

        <div class="col-lg-9">
            <?php 
                $orgAccount = $this->Session->read('org_account');
                $url = "http://" . $_SERVER['HTTP_HOST'] . Configure::read("app_folder") . $orgAccount['Organisation']['slug'] . "/register?category=" . $category['OrganisationMemberCategory']['slug'];  
                
                echo "<a href='$url' target='_blank' class='text-info'>$url</a>";
            ?>
        </div>
    </div>
    
    <div class="row">
        <h4 class="text-info">Settings</h4>
    </div>
    
    <?php foreach($category['OrganisationMemberCategorySetting'] as $setting) { ?>
    <div class="row m-b-sm">
        <div class="col-lg-6">
            <?php echo $setting['MemberCategorySetting']['description']; ?>
        </div>

        <div class="col-lg-6">
            <?php 
            
            switch($setting['MemberCategorySetting']['type']) {
                case 'text':
                case 'number':
                    echo $setting['value'];
                    break;
                
                case 'flag':
                    echo $setting['value'] == "1" ? "<b class='text-success'>On</b>" : "<b>Off</b>";
                    break;
                
                default:
                    echo $setting['value'];
                    break;
            }
            ?>
        </div>
    </div>
    <?php } ?>
</div>
